package com.gavin.ioc.component;

import com.gavin.ioc.model.Student;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;


@Component
public class StudentComponent {
//    @Primary
    @Bean({"s3","s4"})
//    @Bean(name = {"s3","s4"})
//    @Bean(value = {"s3","s4"})
    public Student s1(){
        return new Student("zhangsan",11);
    }
    @Bean
    private String name(){
        return "lisi";
    }
    @Bean
    private String name2(){
        return "lisi2";
    }
    @Bean
    public Student s2(@Qualifier("name2") String n){
        return new Student(n,18);
    }
//
//    @Bean
//    public Student s5(String name){
//        return new Student(name,19);
//    }
}
